<?php
namespace Home\Controller;
use Think\Controller;
class CardController extends Controller {
     //会员卡的查找
     public function find(){
    	  $info=M('card');
    	   $user_id=$_POST['user_id'];
         $infos=$info->where("user_id=$user_id and is_pocket=1")->select();
         echo json_encode($infos);  
       }   
       //会员卡添加 
      public function add(){
    	  $info=M('card');
          $data=$info->create();
         $success= $info->data($data)->add();
         if($success){
         	echo "1";
         }else{
         	echo "0";
         }
       }  

      function index(){
      	var_dump($_POST);
      }
       
}
